/**
 *
 * @param status 设备状态
 * @returns 根据设备状态返回图片名称
 */
export const devStatus2ImgName = (status: DevStatusCode): string => {
  switch (status) {
    case '0184':
      return 'device-online'
    case '0185':
      return 'device-offline'
    case '0186':
      return 'device-fault'
    default:
      return ''
  }
}

/**
 *
 * @param percent 百分比
 * @returns 根据百分比返回图片名称
 */
export const percent2ImgName = (percent: number): string => {
  if (percent === 0) {
    return 'arrow-success'
  } else if (percent > 0) {
    return 'arrow-up-success'
  } else {
    return 'arrow-down-danger'
  }
}

/**
 *
 * @param eventTypeName 日志事件类型名称
 * @returns 根据日志事件类型名称返回图片名
 */
export const eventTypeName2ImageName = (eventTypeName: string): string => {
  switch (eventTypeName) {
    case '设备离线':
      return 'device-offline'
    case '设备上线':
      return 'device-success'
    case '设备故障':
      return 'device-fault'
    default:
      return 'device-normal'
  }
}
